import 'package:flutter/material.dart';
import 'package:flutterdemo/0demo/route/route_params.dart';

import 'routes_name.dart';

class RouteTestPage2 extends StatelessWidget {
  RouteTestPage2.withParam({@required RouteParams params}) {
    print("${params.toString()}");
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text("route test page2")),
      body: Center(
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            RaisedButton(
                onPressed: () {
                  Navigator.popUntil(context, ModalRoute.withName(RoutesName.MAIN_PAGE));
                },
                child: Text("pop until main /"))
          ],
        ),
      ),
    );
  }
}
